package app.caretrack.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "Actors")
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class SysActor extends NamedBaseModel {

    private List<SysResource> resourceList;

    @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
    @JoinTable(name = "Vce_Actor_Resource", inverseJoinColumns = @JoinColumn(name = "Resource_Id"), joinColumns = @JoinColumn(name = "Actor_Id"))
    public List<SysResource> getResourceList() {
        return this.resourceList;
    }

    public void setResourceList(List<SysResource> resourceList) {
        this.resourceList = resourceList;
    }

}
